package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.common.PageDto;
import com.frejoys.common.vo.agent.AgentUserInfoVo;
import com.frejoys.common.vo.app.UserLevelVo;
import com.frejoys.dao.entity.UserLevelPromotion;

import java.util.List;

public interface UserLevelPromotionService extends IService<UserLevelPromotion> {

    default UserLevelPromotion getOnly(QueryWrapper<UserLevelPromotion> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default UserLevelPromotion getOnly(LambdaQueryWrapper<UserLevelPromotion> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    // 获取推荐信息
    UserLevelPromotion getParentInfo(Long childUserId);

//    //一级 层级 达人推广信息
//    List<UserLevelVo> oneUserPromotionInfo(Long userId, PageDto dto);
//
//    //二级 层级 达人推广信息
//    List<UserLevelVo> twoUserPromotionInfo(Long userId, PageDto dto);

    /**
     * 根据id获取组所在达人信息
     */
    List<AgentUserInfoVo> getPromotionUser(Long userId);
}
